//----------------------------------------------------------------------------
//  ,-.
// /_\___ ,   Ninja Framework
// '  ___\    (C) Riccardo Capra - http://riccar.do
//  //   \\
//----------------------------------------------------------------------------
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------------

#ifndef NJ_FUNDAMENTAL_TYPES_CONFIG_H
#	define NJ_FUNDAMENTAL_TYPES_CONFIG_H

#	include "NjNinjaSyncLib.h"

/// \def NJ_TYPES_HASH_IS_64
/// \brief Set to 1 if hash values are stored on 64 bits (0 otherwise)

/// \def NJ_TYPES_FLOAT_IS_64
/// \brief Set to 1 if default float values are stored on 64 bits (0 otherwise)

/// \def NJ_TYPES_CHAR_8_IS_BUILT_IN_TYPE
/// \brief Set to 1 if NjChar8 is a built-in type different from an integer (0 otherwise)

/// \def NJ_TYPES_CHAR_8_IS_SIGNED
/// \brief Set to 1 if NjChar8 is a signed type (0 otherwise)

/// \def NJ_TYPES_CHAR_16_IS_BUILT_IN_TYPE
/// \brief Set to 1 if NjChar16 is a built-in type different from an integer (0 otherwise)

/// \def NJ_TYPES_CHAR_16_IS_SIGNED
/// \brief Set to 1 if NjChar16 is a signed type (0 otherwise)

/// \def NJ_TYPES_CHAR_32_IS_BUILT_IN_TYPE
/// \brief Set to 1 if NjChar32 is a built-in type different from an integer (0 otherwise)

/// \def NJ_TYPES_CHAR_32_IS_SIGNED
/// \brief Set to 1 if NjChar32 is a signed type (0 otherwise)

/// \def NJ_TYPES_BOOL_IS_BUILT_IN_TYPE
/// \brief Set to 1 if NjBool is a built-in type different from an integer (0 otherwise)

#	define NJ_TYPES_HASH_IS_64 1
#	define NJ_TYPES_FLOAT_IS_64 0
#	define NJ_TYPES_CHAR_8_IS_BUILT_IN_TYPE 1
#	define NJ_TYPES_CHAR_8_IS_SIGNED 1

#	if NJ_COMPILER_TYPE_VC
#		define NJ_TYPES_CHAR_16_IS_BUILT_IN_TYPE 1
#		define NJ_TYPES_CHAR_16_IS_SIGNED 0
#		define NJ_TYPES_CHAR_32_IS_BUILT_IN_TYPE 0
#		define NJ_TYPES_CHAR_32_IS_SIGNED 1
#		define NJ_TYPES_CHAR_W_IS_16 1
#	elif NJ_COMPILER_TYPE_GCC
#		if __WCHAR_MAX__>0x10000
#			define NJ_TYPES_CHAR_16_IS_BUILT_IN_TYPE 0
#			define NJ_TYPES_CHAR_16_IS_SIGNED 1
#			define NJ_TYPES_CHAR_32_IS_BUILT_IN_TYPE 1
#			define NJ_TYPES_CHAR_32_IS_SIGNED 0
#			define NJ_TYPES_CHAR_W_IS_16 0
#		else
#			define NJ_TYPES_CHAR_16_IS_BUILT_IN_TYPE 1
#			define NJ_TYPES_CHAR_16_IS_SIGNED 0
#			define NJ_TYPES_CHAR_32_IS_BUILT_IN_TYPE 0
#			define NJ_TYPES_CHAR_32_IS_SIGNED 1
#			define NJ_TYPES_CHAR_W_IS_16 1
#		endif
#	else
#		error "Unsupported build configuration"
#	endif

#	define NJ_TYPES_BOOL_IS_BUILT_IN_TYPE 1

#	ifndef NJ_TYPES_HASH_IS_64
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_HASH_IS_64

#	ifndef NJ_TYPES_FLOAT_IS_64
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_FLOAT_IS_64

#	ifndef NJ_TYPES_CHAR_8_IS_BUILT_IN_TYPE
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_CHAR_8_IS_BUILT_IN_TYPE

#	ifndef NJ_TYPES_CHAR_8_IS_SIGNED
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_CHAR_8_IS_SIGNED

#	ifndef NJ_TYPES_CHAR_16_IS_BUILT_IN_TYPE
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_CHAR_16_IS_BUILT_IN_TYPE

#	ifndef NJ_TYPES_CHAR_16_IS_SIGNED
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_CHAR_16_IS_SIGNED

#	ifndef NJ_TYPES_CHAR_32_IS_BUILT_IN_TYPE
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_CHAR_32_IS_BUILT_IN_TYPE

#	ifndef NJ_TYPES_CHAR_32_IS_SIGNED
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_CHAR_32_IS_SIGNED

#	ifndef NJ_TYPES_CHAR_W_IS_16
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_CHAR_W_IS_16

#	ifndef NJ_TYPES_BOOL_IS_BUILT_IN_TYPE
#		error "Unsupported build configuration"
#	endif // NJ_TYPES_BOOL_IS_BUILT_IN_TYPE

#	if NJ_TYPES_HASH_IS_64
#		define NJ_TYPES_HASH_IS_32 0
#	else // NJ_TYPES_HASH_IS_64
#		define NJ_TYPES_HASH_IS_32 1
#	endif // NJ_TYPES_HASH_IS_64

#	if NJ_TYPES_CHAR_8_IS_SIGNED
#		define NJ_TYPES_CHAR_8_IS_UNSIGNED 0
#	else // NJ_TYPES_CHAR_8_IS_SIGNED
#		define NJ_TYPES_CHAR_8_IS_UNSIGNED 1
#	endif // NJ_TYPES_CHAR_8_IS_SIGNED

#	if NJ_TYPES_CHAR_16_IS_SIGNED
#		define NJ_TYPES_CHAR_16_IS_UNSIGNED 0
#	else // NJ_TYPES_CHAR_16_IS_SIGNED
#		define NJ_TYPES_CHAR_16_IS_UNSIGNED 1
#	endif // NJ_TYPES_CHAR_16_IS_SIGNED

#	if NJ_TYPES_CHAR_32_IS_SIGNED
#		define NJ_TYPES_CHAR_32_IS_UNSIGNED 0
#	else // NJ_TYPES_CHAR_32_IS_SIGNED
#		define NJ_TYPES_CHAR_32_IS_UNSIGNED 1
#	endif // NJ_TYPES_CHAR_32_IS_SIGNED

#	if NJ_TYPES_CHAR_W_IS_16
#		define NJ_TYPES_CHAR_W_IS_32 0
#	else // NJ_TYPES_CHAR_W_IS_16
#		define NJ_TYPES_CHAR_W_IS_32 1
#	endif // NJ_TYPES_CHAR_W_IS_16

#endif // NJ_FUNDAMENTAL_TYPES_CONFIG_H
